package com.jc.dao.impl;

import com.jc.dao.userDao;
import com.jc.entity.User;
import com.jc.mapper.UserMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author luoyong
 * @Date 2021.3.19
 * @Description 用户数据操作层数据库实现类
 */
@Repository
public class userDaoImpl implements userDao {

    @Autowired
    public UserMapper userMapper;

    @Override
    public User getUser(String name, String password) {
        return userMapper.selectBynamepassword(name,password);
    }

    @Override
    public int insertUser(String name, String password) {

        return userMapper.insert(name,password);
    }

    @Override
    public int deleteUser(int id) {

        return userMapper.deleteUser(id);
    }
}
